using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Psi.Domain.BaseEntity;

namespace Psi.EntityFrameworkCore.DbMigrations.Configurations
{
    /// <summary>
    /// 映射配置
    /// </summary>
    public abstract class MasterEntityConfiguration<T> : EntityConfigurationBase<T> where T : MasterEntity
    {
        protected override void Configures(EntityTypeBuilder<T> builder)
        {
            //base.Configures(builder);
            builder.Property(x => x.CreatorId).HasColumnName("creator_id").IsRequired();
            builder.Property(x => x.Creator).HasColumnName("creator").IsRequired().HasMaxLength(50);
            builder.Property(x => x.ReviserId).HasColumnName("reviser_id").IsRequired();
            builder.Property(x => x.Reviser).HasColumnName("reviser").IsRequired().HasMaxLength(50);
            builder.Property(x => x.ReviseTime).HasColumnName("revise_time").IsRequired();
        }
    }
}
